diff options
| author | Factiven <[email protected]> | 2023-04-14 00:14:12 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-04-14 00:14:12 +0700 |
| commit | 70fda74d27d9b55c9030932794daa25c1e6cf50d (patch) | |
| tree | 0c1f639be4e8ec1b960ba642b8e99c1485e83b1a /pages/api/auth/[...nextauth].js | |
| parent | Update 5th (diff) | |
| download | moopa-70fda74d27d9b55c9030932794daa25c1e6cf50d.tar.xz moopa-70fda74d27d9b55c9030932794daa25c1e6cf50d.zip | |
Update 6th
Diffstat (limited to 'pages/api/auth/[...nextauth].js')
| -rw-r--r-- | pages/api/auth/[...nextauth].js | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/pages/api/auth/[...nextauth].js b/pages/api/auth/[...nextauth].js index 571bfdb..b6eae53 100644 --- a/pages/api/auth/[...nextauth].js +++ b/pages/api/auth/[...nextauth].js @@ -1,15 +1,13 @@ import NextAuth from "next-auth"; import { GET_CURRENT_USER } from "../../../queries"; import { client } from "../../../lib/apolloClient"; -import crypto from "crypto"; import clientPromise from "../../../lib/mongodb"; import { MongoDBAdapter } from "@next-auth/mongodb-adapter"; -const jwtSecret = crypto.randomBytes(64).toString("hex"); - export const authOptions = { // Configure one or more authentication providers adapter: MongoDBAdapter(clientPromise), + secret: process.env.NEXTAUTH_SECRET, providers: [ { id: "AniListProvider", @@ -52,15 +50,9 @@ export const authOptions = { }, }, ], - secret: jwtSecret, session: { //Sets the session to use JSON Web Token strategy: "jwt", - cookie: { - // Set the cookie to be secure and HTTP-only - secure: true, - httpOnly: true, - }, }, callbacks: { async jwt({ token, user }) { |